﻿Namespace CustomControls

    Public Class CustomButton
        Inherits Button


        Protected Overrides Sub OnClick(ByVal e As System.EventArgs)

            Dim bDefaultEnabled As Boolean = Me.Enabled
            Try
                Me.Enabled = False

                MyBase.OnClick(e)

            Catch ex As Exception

                Throw ex

            Finally

                Me.Enabled = bDefaultEnabled

            End Try

        End Sub

    End Class

End Namespace